\(\int (d+e x)^m (f+g x) (a d e+(c d^2+a e^2) x+c d e x^2)^{-m} \, dx\) [770]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 42, antiderivative size = 150 \[ \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {\left (a e^2 g+c d (d g (1-m)-e f (2-m))\right ) (d+e x)^{-1+m} \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c^2 d^2 e (1-m) (2-m)}+\frac {g (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d e (2-m)} \]

[Out]

-(a*e^2*g+c*d*(d*g*(1-m)-e*f*(2-m)))*(e*x+d)^(-1+m)*(a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1-m)/c^2/d^2/e/(1-m)/(2
-m)+g*(e*x+d)^m*(a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1-m)/c/d/e/(2-m)

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {808, 662} \[ \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=\frac {g (d+e x)^m \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c d e (2-m)}-\frac {(d+e x)^{m-1} \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m} \left (a e^2 g+c d (d g (1-m)-e f (2-m))\right )}{c^2 d^2 e (1-m) (2-m)} \]

[In]

Int[((d + e*x)^m*(f + g*x))/(a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2)^m,x]

[Out]

-(((a*e^2*g + c*d*(d*g*(1 - m) - e*f*(2 - m)))*(d + e*x)^(-1 + m)*(a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2)^(1 -
 m))/(c^2*d^2*e*(1 - m)*(2 - m))) + (g*(d + e*x)^m*(a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2)^(1 - m))/(c*d*e*(2
- m))

Rule 662

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*(d + e*x)^(m - 1)*
((a + b*x + c*x^2)^(p + 1)/(c*(p + 1))), x] /; FreeQ[{a, b, c, d, e, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[c
*d^2 - b*d*e + a*e^2, 0] &&  !IntegerQ[p] && EqQ[m + p, 0]

Rule 808

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp
[g*(d + e*x)^m*((a + b*x + c*x^2)^(p + 1)/(c*(m + 2*p + 2))), x] + Dist[(m*(g*(c*d - b*e) + c*e*f) + e*(p + 1)
*(2*c*f - b*g))/(c*e*(m + 2*p + 2)), Int[(d + e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g
, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[m + 2*p + 2, 0] && (NeQ[m, 2] || Eq
Q[d, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {g (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d e (2-m)}-\frac {\left (a e^2 g+c d (d g (1-m)-e f (2-m))\right ) \int (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx}{c d e (2-m)} \\ & = -\frac {\left (a e^2 g+c d (d g (1-m)-e f (2-m))\right ) (d+e x)^{-1+m} \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c^2 d^2 e (1-m) (2-m)}+\frac {g (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d e (2-m)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.45 \[ \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {(d+e x)^{-1+m} ((a e+c d x) (d+e x))^{1-m} (a e g+c d (f (-2+m)+g (-1+m) x))}{c^2 d^2 (-2+m) (-1+m)} \]

[In]

Integrate[((d + e*x)^m*(f + g*x))/(a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2)^m,x]

[Out]

-(((d + e*x)^(-1 + m)*((a*e + c*d*x)*(d + e*x))^(1 - m)*(a*e*g + c*d*(f*(-2 + m) + g*(-1 + m)*x)))/(c^2*d^2*(-
2 + m)*(-1 + m)))

Maple [A] (verified)

Time = 1.21 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.59

method result size
gosper \(-\frac {\left (e x +d \right )^{m} \left (c d g m x +c d f m -c d g x +a e g -2 c d f \right ) \left (c d x +a e \right ) \left (c d e \,x^{2}+a \,e^{2} x +c \,d^{2} x +a d e \right )^{-m}}{c^{2} d^{2} \left (m^{2}-3 m +2\right )}\) \(89\)
risch \(-\frac {\left (g \,x^{2} c^{2} d^{2} m +a c d e g m x +c^{2} d^{2} f m x -g \,x^{2} c^{2} d^{2}+a c d e f m -2 c^{2} d^{2} f x +a^{2} e^{2} g -2 a c d e f \right ) \left (c d x +a e \right )^{-m} {\mathrm e}^{\frac {i \pi \,\operatorname {csgn}\left (i \left (c d x +a e \right ) \left (e x +d \right )\right ) m \left (-\operatorname {csgn}\left (i \left (c d x +a e \right ) \left (e x +d \right )\right )+\operatorname {csgn}\left (i \left (c d x +a e \right )\right )\right ) \left (-\operatorname {csgn}\left (i \left (c d x +a e \right ) \left (e x +d \right )\right )+\operatorname {csgn}\left (i \left (e x +d \right )\right )\right )}{2}}}{c^{2} d^{2} \left (-2+m \right ) \left (-1+m \right )}\) \(190\)
parallelrisch \(-\frac {\left (x^{2} \left (e x +d \right )^{m} c^{2} d^{2} e g \,m^{2}-x^{2} \left (e x +d \right )^{m} c^{2} d^{2} e g m +x \left (e x +d \right )^{m} a c d \,e^{2} g \,m^{2}+x \left (e x +d \right )^{m} c^{2} d^{2} e f \,m^{2}-2 x \left (e x +d \right )^{m} c^{2} d^{2} e f m +\left (e x +d \right )^{m} a c d \,e^{2} f \,m^{2}+\left (e x +d \right )^{m} a^{2} g m \,e^{3}-2 \left (e x +d \right )^{m} a c d \,e^{2} f m \right ) \left (c d e \,x^{2}+a \,e^{2} x +c \,d^{2} x +a d e \right )^{-m}}{m e \,c^{2} d^{2} \left (-2+m \right ) \left (-1+m \right )}\) \(206\)

[In]

int((e*x+d)^m*(g*x+f)/((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^m),x,method=_RETURNVERBOSE)

[Out]

-(e*x+d)^m*(c*d*g*m*x+c*d*f*m-c*d*g*x+a*e*g-2*c*d*f)*(c*d*x+a*e)/((c*d*e*x^2+a*e^2*x+c*d^2*x+a*d*e)^m)/c^2/d^2
/(m^2-3*m+2)

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 145, normalized size of antiderivative = 0.97 \[ \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {{\left (a c d e f m - 2 \, a c d e f + a^{2} e^{2} g + {\left (c^{2} d^{2} g m - c^{2} d^{2} g\right )} x^{2} - {\left (2 \, c^{2} d^{2} f - {\left (c^{2} d^{2} f + a c d e g\right )} m\right )} x\right )} {\left (e x + d\right )}^{m}}{{\left (c^{2} d^{2} m^{2} - 3 \, c^{2} d^{2} m + 2 \, c^{2} d^{2}\right )} {\left (c d e x^{2} + a d e + {\left (c d^{2} + a e^{2}\right )} x\right )}^{m}} \]

[In]

integrate((e*x+d)^m*(g*x+f)/((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^m),x, algorithm="fricas")

[Out]

-(a*c*d*e*f*m - 2*a*c*d*e*f + a^2*e^2*g + (c^2*d^2*g*m - c^2*d^2*g)*x^2 - (2*c^2*d^2*f - (c^2*d^2*f + a*c*d*e*
g)*m)*x)*(e*x + d)^m/((c^2*d^2*m^2 - 3*c^2*d^2*m + 2*c^2*d^2)*(c*d*e*x^2 + a*d*e + (c*d^2 + a*e^2)*x)^m)

Sympy [F(-1)]

Timed out. \[ \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=\text {Timed out} \]

[In]

integrate((e*x+d)**m*(g*x+f)/((a*d*e+(a*e**2+c*d**2)*x+c*d*e*x**2)**m),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.63 \[ \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {{\left (c d x + a e\right )} f}{{\left (c d x + a e\right )}^{m} c d {\left (m - 1\right )}} - \frac {{\left (c^{2} d^{2} {\left (m - 1\right )} x^{2} + a c d e m x + a^{2} e^{2}\right )} g}{{\left (m^{2} - 3 \, m + 2\right )} {\left (c d x + a e\right )}^{m} c^{2} d^{2}} \]

[In]

integrate((e*x+d)^m*(g*x+f)/((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^m),x, algorithm="maxima")

[Out]

-(c*d*x + a*e)*f/((c*d*x + a*e)^m*c*d*(m - 1)) - (c^2*d^2*(m - 1)*x^2 + a*c*d*e*m*x + a^2*e^2)*g/((m^2 - 3*m +
 2)*(c*d*x + a*e)^m*c^2*d^2)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 347 vs. \(2 (142) = 284\).

Time = 0.30 (sec) , antiderivative size = 347, normalized size of antiderivative = 2.31 \[ \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {{\left (e x + d\right )}^{m} c^{2} d^{2} g m x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + {\left (e x + d\right )}^{m} c^{2} d^{2} f m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + {\left (e x + d\right )}^{m} a c d e g m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - {\left (e x + d\right )}^{m} c^{2} d^{2} g x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + {\left (e x + d\right )}^{m} a c d e f m e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - 2 \, {\left (e x + d\right )}^{m} c^{2} d^{2} f x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - 2 \, {\left (e x + d\right )}^{m} a c d e f e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + {\left (e x + d\right )}^{m} a^{2} e^{2} g e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )}}{c^{2} d^{2} m^{2} - 3 \, c^{2} d^{2} m + 2 \, c^{2} d^{2}} \]

[In]

integrate((e*x+d)^m*(g*x+f)/((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^m),x, algorithm="giac")

[Out]

-((e*x + d)^m*c^2*d^2*g*m*x^2*e^(-m*log(c*d*x + a*e) - m*log(e*x + d)) + (e*x + d)^m*c^2*d^2*f*m*x*e^(-m*log(c
*d*x + a*e) - m*log(e*x + d)) + (e*x + d)^m*a*c*d*e*g*m*x*e^(-m*log(c*d*x + a*e) - m*log(e*x + d)) - (e*x + d)
^m*c^2*d^2*g*x^2*e^(-m*log(c*d*x + a*e) - m*log(e*x + d)) + (e*x + d)^m*a*c*d*e*f*m*e^(-m*log(c*d*x + a*e) - m
*log(e*x + d)) - 2*(e*x + d)^m*c^2*d^2*f*x*e^(-m*log(c*d*x + a*e) - m*log(e*x + d)) - 2*(e*x + d)^m*a*c*d*e*f*
e^(-m*log(c*d*x + a*e) - m*log(e*x + d)) + (e*x + d)^m*a^2*e^2*g*e^(-m*log(c*d*x + a*e) - m*log(e*x + d)))/(c^
2*d^2*m^2 - 3*c^2*d^2*m + 2*c^2*d^2)

Mupad [B] (verification not implemented)

Time = 12.06 (sec) , antiderivative size = 139, normalized size of antiderivative = 0.93 \[ \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {\frac {g\,x^2\,\left (m-1\right )\,{\left (d+e\,x\right )}^m}{m^2-3\,m+2}+\frac {x\,{\left (d+e\,x\right )}^m\,\left (a\,e\,g\,m-2\,c\,d\,f+c\,d\,f\,m\right )}{c\,d\,\left (m^2-3\,m+2\right )}+\frac {a\,e\,{\left (d+e\,x\right )}^m\,\left (a\,e\,g-2\,c\,d\,f+c\,d\,f\,m\right )}{c^2\,d^2\,\left (m^2-3\,m+2\right )}}{{\left (c\,d\,e\,x^2+\left (c\,d^2+a\,e^2\right )\,x+a\,d\,e\right )}^m} \]

[In]

int(((f + g*x)*(d + e*x)^m)/(x*(a*e^2 + c*d^2) + a*d*e + c*d*e*x^2)^m,x)

[Out]

-((g*x^2*(m - 1)*(d + e*x)^m)/(m^2 - 3*m + 2) + (x*(d + e*x)^m*(a*e*g*m - 2*c*d*f + c*d*f*m))/(c*d*(m^2 - 3*m
+ 2)) + (a*e*(d + e*x)^m*(a*e*g - 2*c*d*f + c*d*f*m))/(c^2*d^2*(m^2 - 3*m + 2)))/(x*(a*e^2 + c*d^2) + a*d*e +
c*d*e*x^2)^m